<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <button @click="routerToTable">点击跳转</button>
    <router-link :to="{ path: '/table'}"> 点我跳转到"渠道分析"demo页</router-link><br/>
    <button @click="routerToHi">点击跳转</button>
    <router-link :to="{ path: '/hi'}"> 点我跳转到"Hi"demo页</router-link>

  </div>
</template>

<script>


export default {
  name: 'hello',
  data () {
    return {
      msg: 'hello here!',
      table:'/table',
      hi:'/hi'
    }
  },
  methods:{
    routerToTable:function(){
      this.$store.commit('changeActiveMenuState',this.table);
      //this.$store.commit('changeActiveMenu',this.table);
      //console.log("bus.$emit(\"routerTo\",\"/table\");")
      //this.$router.push("/table");
    },
    routerToHi:function () {
      this.$store.commit('changeActiveMenuState',this.hi);
    }

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
